<?php
session_start();

$config = include_once('../../public/config/config.php');
include_once('../../public/func/db.php');
$uname = $_POST['uname'];
$pwd = md5($_POST['pwd']);
$where = "where uname='root' and pwd='{$pwd}'";
$res = select($config,'user',$where);
if(!$res){
	echo '<script>alert("验证失败！");window.location.href="/admin/login/login.php"</script>';
}else{
	$_SESSION['admin'] = 'root';
	echo '<script>alert("Welcome back!");window.location.href="/admin/index.php"</script>';
}
